// JavaScript Document
var xmlHttp
var div2
function submitBlogComments(str,div)
{
var name = $('#name'+str).attr('value');
var content = $('#content'+str).attr('value');
div2 = div;
if (str.length==0)
  { 
  document.getElementById("txtHint").innerHTML=""
  return
  }
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  } 
var url="submit.php"
url=url+"?id="+str+"&name="+name+"&content="+content;
url=url+"&sid="+Math.random();
url = encodeURI(url); 
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 
/*function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("photo").innerHTML=xmlHttp.responseText 
 } 
}*/

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}

stateChanged = function()    

{     

     //var sliderBlank = document.getElementById("sidebar");  

     // 让需要显示结果的层显示空白  

     //sliderBlank.innerHTML = " ";   

        

     // 获得loading显示层  

     var loadingDiv = document.getElementById("loading");   

     // 插入loading图  

    loadingDiv.innerHTML = "<img src='images/loading.gif' />";   

     // 显示loading层  

     loadingDiv.style.display = "";   

    // if(xmlReq.readyState == 4)    

     //{     

         // 数据处理完毕之后，将loading层再隐藏掉  

        // loadingDiv.style.display = "none";   

         //alert(xmlReq.responseText);  

         //document.getElementById('content2').innerHTML = xmlReq.responseText;     

         // 输出处理结果  

         //runXML(xmlReq.responseText); 
		 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
  loadingDiv.style.display = "none"; 
 document.getElementById(div2).innerHTML=xmlHttp.responseText 
 } 

     //}     

 } 

